home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #113 (1991-01)(Amiga User Group Deutschland e.V.).zip / Franz PD Disk #113 (1991-01)(Amiga User Group Deutschland e.V.).adf / Rechnungen / rechnungen (.txt) < prev    next >
AmigaBASIC Source Code  |  1989-07-03  |  18KB  |  490 lines

  1. REM    Copyright 1990 by
  2. REM    Andreas Lorenz
  3. REM    Berlinerstr.862
  4. REM    5000 Koeln 80
  5. REM!!!!Bitte durchsuchen Sie das Ganze Listing!!!!!!!!
  6. REM       Es sind 4 Stellen wo Sie Ihre Daten Einsetzen muessen!!
  7.  
  8.  
  9.  
  10. OPEN "R",#1,"Rechnung",50
  11. FIELD #1,8 AS p$,8 AS m$,26 AS k$,8 AS v$
  12. z%=0       
  13.  
  14. SCREEN 1,640,232,3,2
  15. WINDOW 1,"Rechnungen `90",(0,0)-(631,218),2,1
  16. WINDOW OUTPUT 1
  17. ON BREAK GOSUB ende
  18. BREAK ON
  19. COLOR 1,0
  20. Init:
  21. DIM Rot%(8),Gruen%(8),Blau%(8),aktRot%(8),aktGruen%(8),aktblau%(8)
  22.  Rot%(1)= 0 :Gruen%(1)= 0 :Blau%(1)= 0
  23.  Rot%(2)= 15:Gruen%(2)= 15:Blau%(2)= 15
  24.  Rot%(3)= 12:Gruen%(3)= 8 :Blau%(3)= 7
  25.  Rot%(4)= 9 :Gruen%(4)= 5 :Blau%(4)= 3
  26.  Rot%(5)= 15:Gruen%(5)= 15:Blau%(5)= 10
  27.  Rot%(6)= 15:Gruen%(6)= 15:Blau%(6)= 0
  28.  Rot%(7)= 13:Gruen%(7)= 0 :Blau%(7)= 3
  29.  Rot%(8)= 13:Gruen%(8)= 13:Blau%(8)= 11
  30. FOR i%= 1 TO 8
  31.  PALETTE i% -1,Rot%(i%)/15,Gruen%(i%)/15,Blau%(i%)/15
  32. NEXT i%
  33.  
  34. Leer$=SPACE$(80)
  35. cr$= "Rechnungen `90"
  36. MENU 5,0,1,cr$
  37. start:
  38.  GOSUB IOFeld: GOSUB BedinFeld
  39.  AdrQ$ = adr$
  40.  WHILE 1 
  41.   CALL Mklick (0,0,adr%)
  42.   ON adr% GOSUB 1,477,loca,2,PRrINT,ende
  43.   adr$ = AdrQ$                                                          
  44.  WEND
  45. loca:
  46. LOCATE 19,1
  47. PRINT"                                                                                                "
  48.  
  49. LOCATE 10,1
  50. PRINT"                           "
  51. LOCATE 10,1
  52. INPUT "Nr";z%
  53. LOCATE 10,1
  54. PRINT"                           "
  55.  
  56. LOCATE 10,1
  57. PRINT"Neue Eingabe durch Menupunkt Nächster!"
  58.  
  59. PRINT"Wenn Sie weiter machen mit Goto wieder zum Ende der Datei springen"
  60. PRINT"(Ende d.Datei+1)"
  61. b%=z%
  62. GET #1,z% 
  63. LOCATE 19,1
  64. PRINT ""p$""
  65. LOCATE 19,16
  66. PRINT""m$""
  67. LOCATE 19,27
  68. PRINT k$
  69. LOCATE 19,48
  70. PRINT ""v$"DM"
  71. z%=z%-1
  72. b%=b%-1
  73. RETURN
  74. 477 :
  75. LOCATE 19,1
  76. PRINT"                                                                                                "
  77.                                              
  78. LOCATE 10,1
  79. PRINT"                           "
  80. LOCATE 10,1
  81. PRINT"Neue Eingabe durch Menupunkt Nächster!"
  82. PRINT"Einer vor durch Goto(Ende d.Datei+1)(vor Print bitte ans Ende springen!)"
  83. GET #1,z% 
  84. LOCATE 19,1
  85. PRINT ""p$""
  86. LOCATE 19,16
  87. PRINT""m$""
  88. LOCATE 19,27
  89. PRINT k$
  90. LOCATE 19,48
  91. PRINT ""v$"DM"
  92. z%=z%-1
  93. RETURN
  94. 2 :
  95. LOCATE 10,5
  96. PRINT "Empfänger:"
  97. INPUT "Name:";x$
  98. INPUT "Str:";y$
  99. INPUT "Ort:";q$
  100. INPUT "Datum:";d$
  101. INPUT "Zeit d.Rechnung:";e$
  102. INPUT "Richtig (j/n)";h$
  103. IF h$="n" THEN GOTO 2 
  104. IF h$="j" THEN GOTO adr
  105. PRINT "                   "
  106. adr:
  107. LOCATE 1,1
  108. PRINT "                                                                                         "
  109. PRINT "                                                                                         "
  110. PRINT "                                                                                         "
  111. PRINT "                                                                                         "                                                                             
  112. PRINT "                                                                                         "
  113. PRINT "                                                                                         "
  114. PRINT "                                                                                         "
  115. PRINT "                                                                                         "                                                                             
  116. PRINT "                                                                                         "   
  117.  
  118. LOCATE 10,5
  119. PRINT "Drucke Kopf"
  120. LOCATE 1,1
  121. REM Hier muessen Ihre Daten rein
  122. PRINT "Aussteller:"
  123. PRINT "Firma A.Lorenz"
  124. PRINT "Andreas Lorenz"
  125. PRINT "Berliner Str.862"
  126. PRINT "Empfänger:"                       
  127. PRINT ""x$"       
  128. PRINT ""y$""
  129. PRINT ""q$""
  130. LOCATE 1,44
  131. REM Und hier wieder
  132. PRINT "Bank/Postgiro:"
  133. LOCATE 2,44
  134. PRINT "Bank123"
  135. LOCATE 3,44
  136. PRINT "Blz:123456789"
  137. LOCATE 4,44
  138. PRINT "Kto:123456789"
  139. LOCATE 9,1
  140. PRINT "RECHNUNG   Nr."e$""
  141. LOCATE 9,44
  142. PRINT "Datum:"d$""
  143. RETURN
  144. 1 :
  145. LOCATE 10,1
  146. PRINT "                                                                                                                "
  147. PRINT "                                                                                                                "
  148. PRINT "                                                                                                                "
  149. PRINT "                                                                                                                "
  150. PRINT "                                                                                                                "
  151. PRINT "                                                                                                                "
  152. PRINT "                                                                                                                "
  153. PRINT "                                                                                                                "
  154. LOCATE 10,5
  155. PRINT "Eingabe der Daten:"
  156. INPUT"Datum:";a$
  157.  
  158.  
  159. INPUT"Anzahl:";b$
  160.  
  161. INPUT"Bezeichnung:";c$
  162. INPUT"Preis:";l$
  163. INPUT "Richtig (j/n)";h$
  164. IF h$="n" THEN GOTO 1 :ELSE GOTO 12
  165. 12 :
  166. z%=z%+1
  167. IF x=0 THEN
  168. LOCATE 1,1 
  169. PRINT "                                                                                         "
  170. PRINT "                                                                                         "
  171. PRINT "                                                                                         "
  172. PRINT "                                                                                         "                                                                             
  173. PRINT "                                                                                         "
  174. PRINT "                                                                                         "
  175. PRINT "                                                                                         "
  176. PRINT "                                                                                         "                                                                             
  177. PRINT "                                                                                         "   
  178.  
  179. LOCATE 1,1
  180. PRINT"Datum:         Anzahl:    Bezeichung:          Preis:"
  181. f=2
  182. END IF
  183. x=x+1
  184. f=f+1
  185. IF f=9 THEN
  186. LOCATE 1,1
  187. PRINT "                                                                                         "
  188. PRINT "                                                                                         "
  189. PRINT "                                                                                         "
  190. PRINT "                                                                                         "                                                                             
  191. PRINT "                                                                                         "
  192. PRINT "                                                                                         "
  193. PRINT "                                                                                         "
  194. PRINT "                                                                                         "                                                                             
  195. PRINT "                                                                                         "   
  196.  
  197. LOCATE 1,1
  198. PRINT"Datum:         Anzahl:    Bezeichung:          Preis:"
  199. f=2
  200. END IF
  201. LOCATE f,1
  202. PRINT ""a$""
  203. LOCATE f,16
  204. PRINT""b$""
  205. LOCATE f,27
  206. PRINT c$
  207. LOCATE f,48
  208. PRINT ""l$"DM"
  209. LSET p$=a$
  210. LSET m$=b$
  211. LSET k$=c$
  212. LSET v$=l$
  213. PUT #1,z% 
  214. RETURN
  215. PRrINT:
  216. b%=z%
  217. z%=1
  218. a%=a%+1
  219. LOCATE 10,1
  220. PRINT "                                                                   "
  221. PRINT "                                                 "
  222. PRINT "                                                 "
  223. PRINT "                                                 "
  224. PRINT "                                                 "
  225. PRINT "                                                 "
  226. CLOSE #1
  227. LOCATE 10,1
  228. INPUT "Wirklich (j/n)";h$
  229. IF h$="n" THEN RETURN :ELSE GOTO 78
  230.  
  231. 78 :
  232. REM Hier muessen Ihre Daten rein
  233. LPRINT "Aussteller:"
  234. LPRINT "Firma A.Lorenz"
  235. LPRINT "Andreas Lorenz"
  236. LPRINT "Berliner Str.862"
  237. LPRINT "5000 Koeln 80"
  238. LPRINT
  239. LPRINT "Empfänger:";CHR$(13);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"Bank/Postgiro:"
  240. LPRINT ""x$"";CHR$(13);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"Bank123"
  241. LPRINT ""y$"";CHR$(13);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"Blz:12345"
  242. LPRINT CHR$(9);CHR$(9);CHR$(9);CHR$(9);"Kto:12345"
  243. LPRINT ""q$""
  244. LPRINT 
  245. LPRINT
  246. LPRINT
  247. LPRINT  "RECHNUNG    Nr."e$"";CHR$(13);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"Datum:"d$""
  248. LPRINT "Datum:";CHR$(9);"  Anzahl:";CHR$(9);" Bezeichnung:";CHR$(9);CHR$(9);"    Preis:"
  249. OPEN "R",#1,"Rechnung",50
  250. FIELD #1,8 AS p$,8 AS m$,26 AS k$,8 AS v$
  251. b%=b%+1 
  252. 6 :
  253. GET #1,z%
  254. LPRINT ""p$"";CHR$(13);CHR$(9);"  "m$"";CHR$(13);CHR$(9);CHR$(9);CHR$(9);" "k$"";CHR$(13);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"    "v$"DM"
  255. z%=z%+1
  256. IF z%=b% THEN GOTO 56
  257. GOTO 6
  258. 56 :
  259. LOCATE 10,1
  260. PRINT "                          "
  261. PRINT "                                                 "
  262. PRINT "                                                 "
  263. PRINT "                                                 "
  264. PRINT "                                                 "
  265. PRINT "                                                 "
  266.  
  267. LOCATE 10,1
  268. INPUT"Bitte Gesamtergebnis Eingeben:";g$
  269. INPUT"- wieviel Prozent";z$
  270. INPUT"Zu zahlende Summe:";j$
  271. INPUT "Richtig (j/n)";h$
  272. IF h$="n" THEN GOTO 56 :ELSE GOTO 22
  273. 22 :
  274. IF f>=9 THEN
  275. LOCATE 1,1
  276. PRINT "                                                                                         "
  277. PRINT "                                                                                         "
  278. PRINT "                                                                                         "
  279. PRINT "                                                                                         "                                                                             
  280. PRINT "                                                                                         "
  281. PRINT "                                                                                         "
  282. PRINT "                                                                                         "
  283. PRINT "                                                                                         "                                                                             
  284. PRINT "                                                                                         "   
  285. f=2
  286.  
  287. END IF
  288. f=f+1
  289. LOCATE f,48
  290. PRINT"-------"
  291. f=f+1
  292. LOCATE f,48
  293. PRINT""g$"DM"
  294. f=f+1
  295. LOCATE f,48
  296. PRINT"-------"
  297. f=f+1
  298. LOCATE f,45
  299. PRINT "-   "z$"%"
  300. f=f+1
  301. LOCATE f,45
  302. PRINT "=   "j$"DM"
  303. f=f+1
  304. LOCATE f,48
  305. PRINT "======="  
  306. LPRINT CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"    -------"
  307. LPRINT CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"    "g$"DM"
  308. LPRINT CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"    -------"
  309. LPRINT CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"-   "z$"%"
  310. LPRINT CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"=   "j$"DM"
  311. LPRINT CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);CHR$(9);"    ======="
  312. IF a%=2 THEN GOTO ende
  313. RETURN
  314.  
  315. Mausinfo:
  316.  WHILE MOUSE(0) <>0:WEND
  317.  WHILE MOUSE(0)=0:WEND
  318.  LINE (0,0)-(300,88),0,bf
  319.  GOSUB IOFeld
  320.  CALL Tonfolge (1,100)
  321.  CALL klick (303,196,86,14,"INFO",0,1,1,0)
  322. RETURN
  323. ende:
  324.  CALL klick (399,196,86,14,"Ausgang",6,1,1,0)
  325.  CALL Requester ("Wollen Sie Rechnungen`90 verlassen?","JA","","NEIN",98,1,1,2,Flag%)
  326.  IF Flag%=1 THEN
  327.    CLOSE #1
  328.    LIBRARY CLOSE
  329.    WINDOW CLOSE 1
  330.    SCREEN CLOSE 1
  331.    BREAK OFF
  332.    STOP
  333.  END IF  
  334.  IF Flag%= 3 THEN
  335.   GOSUB IOFeld
  336.   LOCATE 1,1
  337.   PRINT "                                                                                         "
  338.   PRINT "                                                                                         "
  339.   PRINT "                                                                                         "
  340.   PRINT "                                                                                         "                                                                             
  341.   PRINT "                                                                                         "
  342.   PRINT "                                                                                         "
  343.   PRINT "                                                                                         "
  344.   PRINT "                                                                                         "                                                                             
  345.   PRINT "                                                                                         "   
  346.   PRINT "                                                                                         "
  347.   PRINT "                                                                                         "
  348.   PRINT "                                                                                         "
  349.   PRINT "                                                                                         "                                                                             
  350.   PRINT "                                                                                         "
  351.   PRINT "                                                                                         "
  352.   PRINT "                                                                                         "
  353.   PRINT "                                                                                         "                                                                             
  354.   PRINT "                                                                                         "   
  355.   PRINT "                                                                                         "                                                                             
  356.   PRINT "                                                                                         "   
  357.  
  358.   CALL klick (399,196,86,14,"Ausgang",0,1,1,0)
  359.   RETURN
  360.  END IF
  361. GOTO ende
  362. IOFeld:
  363.   CALL Fenster (6,3,618,159,1,2,0)
  364. RETURN
  365. BedinFeld:
  366.  CALL Tonfolge (1,100)
  367.  CALL Fenster (6,166,618,50,1,2,0)
  368.  CALL klick ( 15,172,86,14,"Nächster" ,0,1,1,2)
  369.  CALL klick (15,196,86,14,"1er Zur.",0,1,1,2)
  370.  CALL klick (121,172,86,14,"GoTo"   ,0,1,1,2)
  371.  CALL klick (121,196,86,14,"Adresse" ,0,1,1,2)
  372.  CALL klick (399,172,86,14,"Print" ,0,1,1,2)
  373.  CALL klick (399,196,86,14,"Ausgang",0,1,1,2)
  374.        
  375. RETURN
  376. SUB Requester (ReqTxt$,LTxt$,Mtxt$,RTxt$,xSet%,TFarbe%,VFarbe%,hFarbe%,Flag%) STATIC
  377.  CALL Fenster (xSet%,40,295,70,VFarbe%,hFarbe%,1)
  378.  COLOR 1,0
  379.  IF INSTR(1,ReqTxt$,"|")= 0 THEN
  380.   LOCATE 8,3+INT(xSet%/8)
  381.   PRINT ReqTxt$;
  382.  ELSE
  383.    LOCATE 7,3+INT(xSet%/8)
  384.    PRINT LEFT$(ReqTxt$,INSTR(1,ReqTxt$,"|") -1);
  385.    LOCATE 9,3 +INT(xSet%/8)
  386.    PRINT RIGHT$(ReqTxt$,LEN(ReqTxt$) -INSTR(1,ReqTxt$,"|"));       
  387.  END IF
  388.  IF LTxt$ <>"" THEN CALL klick ( 20 +xSet%,84,80,14,LTxt$,0,1,1,0)
  389.  IF Mtxt$ <>"" THEN CALL klick (110 +xSet%,84,80,14,Mtxt$,0,1,1,0) 
  390.  IF RTxt$ <>"" THEN CALL klick (200 +xSet%,84,80,14,RTxt$,0,1,1,0)
  391.  COLOR 0,1
  392.  CALL Tonfolge (1,255)
  393. ReqMaus1:
  394.  WHILE MOUSE(0) <> 0:WEND
  395.  WHILE MOUSE(0) = 0 :WEND
  396.  xPos% =MOUSE(1)
  397.  yPos% =MOUSE(2)
  398.  IF yPos% > 82 AND yPos% < 102 THEN
  399.   IF LTxt$<>"" THEN
  400.    IF xPos%> 20 +xSet% AND xPos% <100 +xSet% THEN Flag%= 1:GOTO reqend
  401.   END IF
  402.   IF Mtxt$<>"" THEN 
  403.    IF xPos%> 110 +xSet% AND xPos% <190 +xSet% THEN Flag%= 2:GOTO reqend
  404.   END IF
  405.   IF RTxt$ <> "" THEN
  406.    IF xPos%> 200 +xSet% AND xPos% <280 +xSet% THEN Flag%= 3:GOTO reqend
  407.   END IF
  408.  END IF
  409. GOTO ReqMaus1
  410. reqend:
  411.  COLOR 1,0
  412.  CALL Tonfolge (1,100)
  413. END SUB
  414. SUB Mklick (xPos%,yPos%,adr%) STATIC
  415.  SHARED adr$
  416.  adr%=0
  417.  WHILE MOUSE(0) <> 0:WEND
  418.  WHILE MOUSE(0) =  0:WEND
  419.  xPos% = MOUSE(1) : yPos% = MOUSE(2)
  420.  FOR i% = 1 TO LEN(adr$) STEP 12
  421.   IF xPos% > VAL(MID$(adr$,i%,3))THEN
  422.    IF xPos% < VAL(MID$(adr$,i% +3,3)) THEN
  423.     IF yPos% > VAL(MID$(adr$,i% +6,3)) THEN
  424.      IF yPos% < VAL(MID$(adr$,i% +9,3)) THEN
  425.       adr% = INT((i%-1)/12) +1
  426.       i% = LEN(adr$)
  427.      END IF
  428.     END IF
  429.    END IF
  430.   END IF
  431.  NEXT i%
  432. END SUB
  433. SUB klick(xPos%,yPos%,breit%,hoch%,Txt$,VGrund%,Hgrund%,aktiv%,Mode%) STATIC
  434.  SHARED adr$
  435.  LINE (xPos%,yPos%+2)-(xPos%+breit%+4,yPos%+hoch%+2),0,bf      
  436.  LINE (xPos%,yPos%)-(xPos%+breit%,yPos%+hoch%),VGrund%,bf
  437.  LINE (xPos%+2,yPos%+1)-(xPos%+breit%-2,yPos%+hoch%-1),Hgrund%,bf
  438.  XTP%=INT(xPos%+((breit%-(LEN(Txt$)*8))/2)+0.5)
  439.  yTP%=INT(yPos%+((hoch%+8)/2)+0.5)-1
  440.  POKEW WINDOW(8)+36,XTP%:POKEW WINDOW(8)+38,yTP%
  441.  COLOR VGrund%,Hgrund%:PRINT Txt$;
  442.  IF aktiv%=0 THEN 
  443.   FOR i%=yTP%-7 TO yTP%-1 STEP 2
  444.    LINE(XTP%,i%)-(XTP%+(LEN(Text$)*8),i%),Hgrund%,b
  445.   NEXT i%
  446.   breit%=999:hoch%=999         
  447.  END IF
  448.  IF Mode%=1 THEN
  449.   adr$=RIGHT$(" "+STR$(xPos%),3)+RIGHT$(" "+STR$(xPos%+breit%),3)
  450.   adr$=adr$+RIGHT$(" "+STR$(yPos%),3)+RIGHT$(" "+STR$(yPos%+hoch%),3)
  451.  END IF
  452.   IF Mode%=2 THEN
  453.   adr$=adr$+RIGHT$(" "+STR$(xPos%),3)+RIGHT$(" "+STR$(xPos%+breit%),3)
  454.   adr$=adr$+RIGHT$(" "+STR$(yPos%),3)+RIGHT$(" "+STR$(yPos%+hoch%),3)
  455.  END IF
  456.  
  457. END SUB
  458. SUB Fenster (xPos%,yPos%,breit%,hoch%,VFarbe%,hFarbe%,Schatten%) STATIC
  459. IF Schtten%=1 THEN
  460.  LINE (xPos%+6,yPos%+2)-(xPos%+breit%+6,yPos%+hoch%+3),0,bf
  461. END IF
  462. LINE (xPos%,yPos%)-(xPos%+breit%,yPos+hoch%),VFarbe,b
  463. LINE (xPos%+1,yPos%)-(xPos%+breit%-1,yPos%+hoch%),VFarbe,b 
  464. LINE (xPos%+2,yPos%+1)-(xPos%+breit%-2,yPos%+hoch%-1),VFarbe,b
  465. LINE (xPos%+3,yPos%+1)-(xPos%+breit%-3,yPos%+hoch%-1),VFarbe,b
  466. LINE (xPos%+4,yPos%+2)-(xPos%+breit%-4,yPos%+hoch%-2),hFarbe,b
  467. END SUB
  468. SUB Tonfolge (SFolge%,LautSt%) STATIC    
  469.  FOR Ton=1 TO SFolge%
  470.   SOUND 493,1,LautSt%,0:SOUND 1046,1,LautSt%,0
  471.   SOUND 587,1,LautSt%,0
  472.  NEXT Ton
  473. END SUB
  474.     
  475.     
  476.    
  477.     
  478.   
  479.   
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.